# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        黄周云  
# Name:         text15
# Description:  生成器
# Author:       ASUS
# Date:         2019/4/3
#-------------------------------------------------------------------------------


#定义一个生成器函数
def myGenerator():
    numList = [1,2,3,4,5,6,7,8]
    for num in numList:
        yield num
#对生成器进行迭代
for num in myGenerator():
    print(num,end=' ')



